import {createRouter,createWebHistory} from "vue-router";
import {ElMessage} from "element-plus";
const routes = [
    {
        name:'login',
        path:'/login',
        meta:'登录',
        component:()=>import("../views/Login.vue")
    },
    {
        name: 'DashBoard',
        path: '/',
        meta: {title:'首页'},
        component:()=>import("../views/DashBoard.vue"),
        children:[
            // {
            //     name:'DashBoard',
            //     path:'/',
            //     meta:'首页',
            //     component:()=>import("../views/Works.vue")
            // },
            {
                name:'flowableManagement',
                path:'/flowableCenter/flowableManagement',
                meta:'flowableManagement',
                component:()=>import("../views/capacity/lbw/flowableManagement.vue")
            },
            {
                name:'flowableMyalready',
                path:'/flowableCenter/flowableMyalready',
                meta:'flowableMyalready',
                component:()=>import("../views/capacity/lbw/flowableMyalready.vue")
            },
            {
                name:'flowableMySend',
                path:'/flowableCenter/flowableMySend',
                meta:'flowableMySend',
                component:()=>import("../views/capacity/lbw/flowableMySend.vue")
            },
            {
                name:'EmpSalaryDetail',
                path:'/salary/EmpSalaryDetail',
                meta:'EmpSalaryDetail',
                component:()=>import("../views/capacity/lbw/EmpSalaryDetail.vue")
            },
            {
                name:'flowableMyWait',
                path:'/flowableCenter/flowableMyWait',
                meta:'flowableMySend',
                component:()=>import("../views/capacity/lbw/flowableMyWait.vue")
            },
            {
                name:'PersonalCenter',
                path:'/',
                meta:'个人中心',
                component:()=>import("../views/capacity/lbw/PersonalCenter.vue")
            },
            {
                name:'BasicSalaryCalculation',
                path: '/mysalary/basicSalaryCalculation',
                meta: '基本工资计算',
                component:()=>import("../views/capacity/lbw/BasicSalaryCalculation .vue")
            },
            {
                name:'AttendanceCalculation',
                path: '/mysalary/attendanceCalculation',
                meta: '考勤计算',
                component:()=>import("../views/capacity/lbw/AttendanceCalculation.vue")
            },
            {
                name:'CompanySubsidyCalculation',
                path:'/companySubsidyCalculation',
                meta:'公司补贴计算',
                component:()=>import("../views/capacity/lbw/CompanySubsidyCalculation.vue")
            },
            {
                name:'FiveInsOneGoldScale',
                path:'/salary/fiveInsOneGoldScale',
                meta:'五险一金比例表',
                component:()=>import("../views/capacity/lbw/FiveInsOneGoldScale.vue")
            },
            {
                name:'Payroll',
                path:'/mysalary/payroll',
                meta:'工资单',
                component:()=>import("../views/capacity/lbw/Payroll.vue")
            },
            {
                name:'empaPerssionSalary',
                path:'salary/empaPerssionSalary',
                meta:'员工个人薪资',
                component:()=>import("../views/capacity/lbw/empPerssionSalary.vue")
            },
            {
                name:'EmployeeSalaryComposition',
                path:'/salary/employeeSalaryComposition',
                meta:'员工薪资构成',
                component:()=>import("../views/capacity/lbw/EmployeeSalaryComposition.vue")
            },
            {
                name:'EmployeeSalaryAccounting',
                path:'/salary/employeeSalaryAccounting',
                meta:'员工薪资核算',
                component:()=>import("../views/capacity/lbw/EmployeeSalaryAccounting.vue")
            },
            {
                name:'lbw5',
                path:'/salary/xiubiao',
                meta:'lbw5',
                component:()=>import("../views/capacity/lbw/updateJILu.vue")
            },
            {
                name:'员工福利申请',
                path:'/salary/welfare/employeeWelfareApply',
                meta:'lbw6',
                component:()=>import("../views/capacity/lbw/EmployeeWelfareApply.vue")
            },
            {
                name:'员工福利查看',
                path:'/salary/welfare/employeeWelfare',
                meta:'lbw7',
                component:()=>import("../views/capacity/lbw/EmployeeWelfare.vue")
            },
            {
                name:'员工薪资审核',
                path:'/salary/employeesalarySh',
                meta:'lbw7',
                component:()=>import("../views/capacity/lbw/EmployeesalarySh.vue")
            },
            {
                name:'员工福利详情',
                path: '/salary/welfare/query/welfareDetail',
                meta: '员工福利详情',
                component:()=>import("../views/capacity/lbw/WelfareDetail.vue")
            },
            {
                name:'PublicGoods',
                path: '/logisticsManage/publicGoods',
                meta: '公共物品',
                component:()=>import("../views/capacity/cxl/PublicGoods.vue")
            },
            {
                name:'PurchaseOrder',
                path: '/logisticsManage/purchase/PurchassOrder',
                meta: '采购订单',
                component:()=>import("../views/capacity/cxl/PurchaseOrder.vue")
            },
            {
                name:'PurchaseOrderDetail',
                path: '/logisticsManage/purchase/PurchaseOrderDetail',
                meta: '采购订单详情',
                component:()=>import("../views/capacity/cxl/PurchaseOrderDetail.vue")
            },
            {
                name:'PublicWarehouse',
                path: '/logisticsManage/Warehouse/public',
                meta: '公共仓库管理',
                component:()=>import("../views/capacity/cxl/PublicWarehouse.vue")
            },
            {
                name:'Warehouse',
                path: '/logisticsManage/Warehouse/Manage',
                meta: '仓库管理',
                component:()=>import("../views/capacity/cxl/Warehouse.vue")
            },
            {
                name:'CollectItems',
                path: '/logisticsManage/collectionGoods/collectItems',
                meta: '领取物品',
                component:()=>import("../views/capacity/cxl/CollectItems.vue")
            },
            {
                name:'CollectTemplate',
                path: '/logisticsManage/collectionGoods/collectTemplate',
                meta: '领取模板',
                component:()=>import("../views/capacity/cxl/CollectTemplate.vue")
            },
            {
                name:'ReceivingRecords',
                path: '/logisticsManage/collectionGoods/receivingRecords',
                meta: '领取记录',
                component:()=>import("../views/capacity/cxl/ReceivingRecords.vue")
            },
            {
                name:'RepairReplaceRecord',
                path: '/logisticsManage/repairReplace/repairReplaceRecord',
                meta: '维修、更换记录',
                component:()=>import("../views/capacity/cxl/RepairReplaceRecord.vue")
            },
            {
                name:'DetailsPurchaseRequisitionRecord',
                path: '/logisticsManage/self',
                meta: '个人物品',
                component:()=>import("../views/capacity/cxl/DetailsPurchaseRequisitionRecord.vue")
            },
            {
                name:'LogisticsMaintenance',
                path: '/logisticsManage/repairReplace/logisticsMaintenance',
                meta: '后勤维修',
                component:()=>import("../views/capacity/cxl/LogisticsMaintenance.vue")
            },
            {
                name:'LogisticsReplacement',
                path: '/logisticsManage/repairReplace/logisticsReplacement',
                meta: '后勤更换',
                component:()=>import("../views/capacity/cxl/LogisticsReplacement.vue")
            },
            {
              name: 'RequisitionPurchaseOrderRecord',
              path: '/logisticsManage/purchase/requisitionPurchaseOrderRecord',
              meta: '申请采购记录',
              component:()=>import("../views/capacity/cxl/RequisitionPurchaseOrderRecord.vue")
            },
            {
                name:'MyInvoice',
                path: '/fkgl/myInvoice',
                meta: '我的发票',
                component:()=>import("../views/capacity/hj/MyInvoice.vue")
            },
            {
                name:'AppendDetails',
                path: '/fkgl/AppendDetails',
                meta: '追加详情表',
                component:()=>import("../views/capacity/hj/AppendDetails.vue")
            },
            {
                name:'ChangeDetails',
                path: '/fkgl/ChangeDetails',
                meta: '追加详情表',
                component:()=>import("../views/capacity/hj/ChangeDetails.vue")
            },
            {
                name:'DiscriminationRecord',
                path: '/fkgl/DiscriminationRecord',
                meta: '辨伪记录表',
                component:()=>import("../views/capacity/hj/DiscriminationRecord.vue")
            },
            {
                name:'MyReimbursement',
                path: '/fkgl/myReimbursement',
                meta: '我的报销',
                component:()=>import("../views/capacity/hj/MyReimbursement.vue")
            },
            {
                name:'ReimbursementInitiation',
                path:'/reimbursementInitiation',
                meta:'报销发起',
                component:()=>import("../views/capacity/hj/ReimbursementInitiation.vue")
            },
            {
                name:'BudgetAdjustment',
                path: '/fkgl/ysgl/budgetAdjustment',
                meta: '预算调整',
                component:()=>import("../views/capacity/hj/BudgetAdjustment.vue")
            },
            {
                name:'BudgetQuery',
                path: '/fkgl/ysgl/budgetQuery',
                meta: '预算查询',
                component:()=>import("../views/capacity/hj/BudgetQuery.vue")
            },
            {
                name:'BudgetAmendment',
                path: '/budgetAmendment',
                meta: '预算追加',
                component:()=>import("../views/capacity/hj/BudgetAmendment.vue")
            },
            {
                name:'BudgetChanges',
                path: '/budgetChanges',
                meta: '预算变更',
                component:()=>import("../views/capacity/hj/BudgetChanges.vue")
            },
            {
                name:'InvoiceIdentification',
                path: '/fkgl/invoiceIdentification',
                meta: '发票辨别',
                component:()=>import("../views/capacity/hj/InvoiceIdentification.vue")
            },
            {
                name:'BudgetApproval',
                path: '/fkgl/ysgl/budgetApproval',
                meta: '预算审批',
                component:()=>import("../views/capacity/hj/BudgetApproval.vue")
            },
            {
                name:'TravelReimbursementStandard',
                path: '/travelReimbursementStandard',
                meta: '差旅报销标准',
                component:()=>import("../views/capacity/hj/TravelReimbursementStandard.vue")
            },
            {
                name:'InvoiceAdd',
                path: '/invoiceAdd',
                meta: '发票添加',
                component:()=>import("../views/capacity/hj/InvoiceAdd.vue")
            },
            {
                name:'TravelInitiation',
                path: '/travelInitiation',
                meta: '差旅报销发起',
                component:()=>import("../views/capacity/hj/TravelInitiation.vue")
            },
            {
                name:'CompanyAttendance',
                path: '/attendance/company',
                meta: '公司考勤',
                component:()=>import("../views/capacity/cjl/CompanyAttendance.vue")
            },
            {
                name:'RoleManagement',
                path: '/system/role',
                meta: '角色管理',
                component:()=>import("../views/capacity/cjl/RoleManagement.vue")
            },
            {
                name:'PersonalAttendance',
                path: '/attendance/personal',
                meta: '个人考勤',
                component:()=>import("../views/capacity/cjl/PersonalAttendance.vue")
            },
            {
                name:'OneDate',
                path: '/attendance/report/onDate',
                meta: '每日统计报表',
                component:()=>import("../views/capacity/cjl/OneDate.vue")
            },
            {
                name:'PermissionManagement ',
                path: '/system/permission',
                meta: '权限管理',
                component:()=>import("../views/capacity/cjl/PermissionManagement.vue")
            },
            {
                name:'RoleAssignments',
                path: '/RoleAssignments',
                meta: '请假申请',
                component:()=>import("../views/capacity/cjl/RoleAssignments.vue")
            },
            {
                name:'TravelApplication',
                path: '/attendance/ap/travel',
                meta: '出差申请',
                component:()=>import("../views/capacity/cjl/TravelApplication.vue")
            },
            {
                name:'OvertimeApplication',
                path: '/attendance/ap/overTime',
                meta: '加班申请',
                component:()=>import("../views/capacity/cjl/OvertimeApplication.vue")

            },
            {
                name:'ApplyCard',
                path: '/attendance/ap/applyCard',
                meta: '申请补卡',
                component:()=>import("../views/capacity/cjl/ApplyCard.vue")

            },
            {
                name:'LeaveApply',
                path: '/attendance/ap/leaveApply',
                meta: '请假申请',
                component:()=>import("../views/capacity/cjl/LeaveApply.vue")

            },
            {
                name:'OriginalPunchRecord',
                path: '/attendance/report/originalPunchRecored',
                meta: '原始打卡记录',
                component:()=>import("../views/capacity/cjl/OriginalPunchRecord.vue")

            },
            {
                name:'MonthlyAttendance',
                path: '/attendance/report/month',
                meta: '每月统计考勤',
                component:()=>import("../views/capacity/cjl/MonthlyAttendance.vue")

            },
            {
                name:'eee',
                path: '/eee',
                meta: 'eee',
                component:()=>import("../views/capacity/cjl/eee.vue")

            },
            {
                name:'DeptManagement',
                path: '/system/dept',
                meta: '部门管理',
                component:()=>import("../views/capacity/cjl/DeptManagement.vue")

            },
            {
                name:'EmpManagement',
                path: '/empManagement',
                meta: '员工管理',
                component:()=>import("../views/capacity/cjl/EmpManagement.vue")

            },
            {
                name:'UserAssignments',
                path: '/userAssignments',
                meta: '用户授权',
                component:()=>import("../views/capacity/cjl/UserAssignments.vue")

            },
            {
                name:'UserManagement',
                path: '/system/user',
                meta: '用户管理',
                component:()=>import("../views/capacity/cjl/UserManagement.vue")

            },
            {
                name:'',
                path: '/Recruitment/myconcern',
                meta: '',
                component:()=>import("../views/capacity/hy/Myconcern.vue")
            },
            {
                name:'InterviewDetails',
                path: '/Recruitment/interview/InterviewDetails',
                meta: '',
                component:()=>import("../views/capacity/hy/InterviewDetails.vue")
            },
            {
                name:'jobfabu',
                path: '/Recruitment/resume/jobfabu',
                meta: '',
                component:()=>import("../views/capacity/hy/jobfabu.vue")
            },
            {
                name:'tiao',
                path: '/Recruitment/resume/tiao',
                meta: '',
                component:()=>import("../views/capacity/hy/Addresume.vue")
            },
            {
                name:'Ralents',
                path: '/Recruitment/talents',
                meta: '人才库',
                component:()=>import("../views/capacity/hy/talents.vue")
            },
            {
                name:'岗位管理',
                path: '/system/post',
                meta: 'post',
                component:()=>import("../views/capacity/hy/post.vue")
            },
            {
                name:'岗位需求',
                path: '/Recruitment/jobrequirement',
                meta: 'jobrequirement',
                component:()=>import("../views/capacity/hy/jobrequirement.vue")
            },
            {
                name:'简历管理',
                path: '/Recruitment/resume',
                meta: 'resume',
                component:()=>import("../views/capacity/hy/resume.vue")
            },
            {
                name:'面试管理',
                path: '/Recruitment/interview',
                meta: 'interview',
                component:()=>import("../views/capacity/hy/interview.vue")
            },
            {
                name:'入职通过',
                path: '/Recruitment/post/application',
                meta: 'entry',
                component:()=>import("../views/capacity/hy/entry.vue")
            },
            {
                name:'InterviewArrangementProcess',
                path: '/Recruitment/interview/InterviewArrangementProcess',
                meta: '面试安排流程',
                component:()=>import("../views/capacity/hy/InterviewArrangementProcess.vue")
            },
            {
                name:'offer',
                path: '/Recruitment/interview/offer',
                meta: 'offer',
                component:()=>import("../views/capacity/hy/Offer.vue")
            },
            {
                name:'hy300',
                path: '/hy300',
                meta: 'hy300',
                component:()=>import("../views/capacity/hy/hy300.vue")
            },
            {
                name:'入职管理',
                path: '/perrelationship/entry/rzgl',
                meta: '入职管理',
                component:()=>import("../views/capacity/zf/ContractSigning.vue")
            },
            {
                name:'EnrollmentApplication',
                path: '/perrelationship/entry/entry_record',
                meta: '入职申请',
                component:()=>import("../views/capacity/zf/EnrollmentApplication.vue")
            },
            {
                name:'345',
                path: '/perrelationship/bargain/contract/empfiles',
                meta: '合同签署',
                component:()=>import("../views/capacity/zf/EmpFiles.vue")
            },
            {
                name:'EmpFiles',
                path: '/perrelationship/entry/recruits/empfiles',
                meta: '试用合同',
                component:()=>import("../views/capacity/zf/EmpFiles.vue")
            },
            {
                name:'NewContractSign',
                path: '/perrelationship/bargain/contract/newcontractsign',
                meta: '正式合同',
                component:()=>import("../views/capacity/zf/NewContractSign.vue")
            },
            {
                name:'RelieveContractSign',
                path: '/perrelationship/bargain/contract/relievecontractsign',
                meta: '解除合同签署',
                component:()=>import("../views/capacity/zf/RelieveContractSign.vue")
            },
            // {
            //     name:'RenewalContractSign',
            //     path: '/perrelationship/bargain/contract/newcontractsign',
            //     meta: '续签合同签署',
            //     component:()=>import("../views/capacity/zf/RenewalContractSign.vue")
            // },
            {
                name:'InductionManagement',
                path: '/perrelationship/entry/recruits',
                meta: '入职申请',
                component:()=>import("../views/capacity/zf/InductionManagement.vue")
            },
            {
                name:'LeaveManagement',
                path: '/perrelationship/leaveoffice/dimission',
                meta: '离职管理',
                component:()=>import("../views/capacity/zf/LeaveManagement.vue")
            },
            {
                name:'dimapplyforAp',
                path: '/perrelationship/leaveoffice/ap',
                meta: '裁员申请',
                component:()=>import("../views/capacity/zf/dimapplyfor.vue")
            },
            {
                name:'EmploymentConfirmationManagement',
                path: '/perrelationship/regularization/positive',
                meta: '转正管理',
                component:()=>import("../views/capacity/zf/EmploymentConfirmationManagement.vue")
            },
            {
                name:'posapplyfor',
                path: '/perrelationship/regularization/ap',
                meta: '转正申请',
                component:()=>import("../views/capacity/zf/posapplyfor.vue")
            },
            {
                name:'mobility',
                path: '/perrelationship/jobtransfer/mobility',
                meta: '转正管理',
                component:()=>import("../views/capacity/zf/JobTransferManagement.vue")
            },
            {
                name:'jobtransferAp',
                path: '/perrelationship/jobtransfer/ap',
                meta: '转岗管理',
                component:()=>import("../views/capacity/zf/mobapplyfor.vue")
            },
            {
                name:'ContractManagement',
                path: '/perrelationship/bargain/contract',
                meta: '合同管理',
                component:()=>import("../views/capacity/zf/ContractManagement.vue")
            },

        ]
    },

]
const router = createRouter({
    routes,
    history:createWebHistory()//去掉#
});
//路由拦截器,在路由加载之前
router.beforeEach((to, from, next)=>{
    let store = localStorage.getItem("token")
    if(!store && to.path != '/login'){//用户为空并且访问的不是登录页面
        ElMessage({message:'请登录',type:'warning'})
        next("/login")//指定回到登录页面
    }else{
        next() //跳转到需要访问的页面
    }
})
export default router;